﻿@model MvcUI.Models.ListUserViewModel
@{
    Layout = null;
}
@using (Html.BeginForm("List", "MUser", FormMethod.Post, new { id = "pagerForm" }))
{
    <input type="hidden" name="pageNum" value="@Model.PagingInfo.CurrentPage" />
    <input type="hidden" name="numPerPage" value="@Model.PagingInfo.ItemsPerPage" />
    <input type="hidden" name="orderField" value="@Model.PagingInfo.OrderField" />
    <input type="hidden" name="orderDirection" value="@Model.PagingInfo.OrderDirection" />
}
<div class="pageHeader">
    @using (Html.BeginForm("List", "MUser", FormMethod.Post, new { rel = "pagerForm", onsubmit = "return navTabSearch(this);" }))
    {
        <div class="searchBar">
            <ul class="searchContent">
                <li>
                    <label>
                        用户名：</label>
                    <input type="text" name="keywords" value="@Model.KeyWord" />
                </li>
            </ul>
            <div class="subBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">
                                    检索</button></div>
                        </div>
                    </li>
                    @*  <li><a class="button" href="" target="dialog" mask="true" title="查询框"><span>高级检索</span></a></li>*@
                </ul>
            </div>
        </div>
    }
</div>
<div class="pageContent">
    <div class="panelBar">
        <ul class="toolBar">
            <li><a href="@Url.Action("Add", "MUser")" target = "dialog",close="refreshUserTab",param="{msg:'gogo'}", mask = "true", rel = "AddUser", class = "add" title="添加">
                <span>添加</span> </a></li>
            <li class="line">line</li>
            <li><a title="确实要删除这些记录吗?" target="selectedTodo" rel="ids" href="@Url.Action("DeleteBatch", "MUser")" class="delete">
                <span>批量删除</span></a></li>
        </ul>
    </div>
    <table class="table" layouth="138">
        <thead>
            <tr>
                <th>
                    <input type="checkbox" group="ids" class="checkboxCtrl">
                </th>
                <th  orderfield="UserName" class="@Model.PagingInfo.OrderDirection">
                    用户名
                </th>
                <th width="90">
                    电话号码
                </th>
                <th width="130">
                    邮箱
                </th>
                <th width="70">
                    是否可用
                </th>
                <th>
                    创建者
                </th>
                <th width="130">
                    创建时间
                </th>
                <th>
                    修改者
                </th>
                <th width="130">
                    修改时间
                </th>
                <th width="60">
                    操作
                </th>
            </tr>
        </thead>
        <tbody>
            @foreach (var s in Model.Users)
            { 
                <tr target="sid_user" rel="@s.ID">
                    <td>
                        <input name="ids" value="@s.ID" type="checkbox">
                    </td>
                    <td>@s.UserName
                    </td>
                    <td>@s.Phone
                    </td>
                    <td>@s.Email
                    </td>
                    <td>@s.Enabled
                    </td>
                    <td>@s.Creator
                    </td>
                    <td>@s.CreateTime
                    </td>
                    <td>@s.Updator
                    </td>
                    <td>@s.UpdateTime
                    </td>
                    <td>
                        <a title="删除" target="ajaxTodo" href="@Url.Action("Delete", "MUser", new { id = @s.ID })" class="btnDel">
                            删除</a> <a title="编辑" target = "dialog" href="@Url.Action("Edit", "MUser", new { id = @s.ID })" mask = "true" class="btnEdit">
                                编辑</a>
                    </td>
                </tr>
            }
        </tbody>
    </table>
    <div class="panelBar">
        <div class="pages">
            <span>每页显示</span>
            <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
                <option value="20">20</option>
                <option value="50">50</option>
                <option value="100">100</option>
                <option value="200">200</option>
            </select>
            <span>条，共
                @Model.PagingInfo.TotalItems
                条</span>
        </div>
        <div class="pagination" targettype="navTab" totalcount="@Model.PagingInfo.TotalItems" numperpage="@Model.PagingInfo.ItemsPerPage" pagenumshown="8"
            currentpage="@Model.PagingInfo.CurrentPage">
        </div>
    </div>
</div>
